#!/bin/sh -e

export DESTDIR="$1"

meson \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    -Dlibmpdclient=disabled \
    . output

ninja -C output
ninja -C output install

# Add mpd service file
install -Dm755 mpd.run "$1/etc/sv/mpd/run"
ln -sf /run/runit/supervise.mpd "$1/etc/sv/mpd/supervise"
